﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XiaoYuJi.Entity;
using XiaoYuJi.Entity.BusEntitys;
using XiaoYuJi.Repository;
using XiaoYuJi.Service.IServices.IBusService;

namespace XiaoYuJi.Service.BusServices;
public class ClassifyService : BaseService<Classify>, IClassifyService
{
    public ClassifyService(IBaseRepository<Classify> repository)
        : base(repository)
    {

    }

    public async Task<ApiResult<List<Classify>>> GetClassifyList(string key)
    {
        List<Classify> classifyList = await base.Query(e => e.IsDelete == false).ToListAsync();

        ApiResult<List<Classify>> apiResult = new();
        apiResult.Data = classifyList;
        apiResult.Message = "获取分类列表~";

        return apiResult;
    }
}
